/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bff.mpd.musicjukebox.ui.components;

import com.bff.mpd.musicjukebox.lib.JukeboxProperties;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.JButton;
import org.bff.javampd.MPDPlayer;

/**
 *
 * @author bfindeisen
 */
public abstract class PlayerButton
        extends JButton
        implements MouseListener {

    private MPDPlayer player;

    public PlayerButton() {
       this.player = JukeboxProperties.getInstance().getPlayer();
        setAction();

        addMouseListener(this);
    }

    /**
     * @return the player
     */
    public MPDPlayer getPlayer() {
        return player;
    }

    /**
     * @param player the player to set
     */
    public void setPlayer(MPDPlayer player) {
        this.player = player;
    }

    @Override
    public void mouseClicked(MouseEvent e) {
        //throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void mousePressed(MouseEvent e) {
        setMousePressedIcon();
    }

    @Override
    public void mouseReleased(MouseEvent e) {
        setMouseReleasedIcon();
    }

    @Override
    public void mouseEntered(MouseEvent e) {
        setMouseEnteredIcon();
    }

    @Override
    public void mouseExited(MouseEvent e) {
        setMouseExitedIcon();
    }

    protected abstract void setMousePressedIcon();

    protected abstract void setMouseEnteredIcon();

    protected abstract void setMouseExitedIcon();

    protected abstract void setAction();

    protected abstract void setMouseReleasedIcon();
}
